package com.lsh.payment.worker.task;

import com.dangdang.ddframe.job.api.JobExecutionMultipleShardingContext;
import com.dangdang.ddframe.job.plugin.job.type.simple.AbstractSimpleElasticJob;
import com.lsh.base.trace.id.filter.TraceIdSetter;
import com.lsh.payment.core.constant.BusinessConstant;
import com.lsh.payment.core.service.payment.impl.PaymentNotifyTaskService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Project Name: lsh-payment
 *
 * @author peter
 * @date 16/11/13
 * 北京链商电子商务有限公司
 * Package
 * desc:
 */
@Component
public class PaymentNotifyHistoryJop extends AbstractSimpleElasticJob {

    private static Logger logger = LoggerFactory.getLogger(PaymentNotifyHistoryJop.class);

    @Autowired
    private PaymentNotifyTaskService paymentNotifyTaskService;


    @Override
    public void process(JobExecutionMultipleShardingContext jobContext) {
        TraceIdSetter.set();
        logger.info("删除回调成功提醒开始");
        paymentNotifyTaskService.deletePayTasks(BusinessConstant.TMS_TASK_STATUS_SUCCESS);
        logger.info("删除回调成功提醒完成");
    }

}
